<template>
  <div>
    <el-card shadow="never" class="mb20" style="overflow: inherit">
      <dispose-form ref="disposeForm" @search="handleSearch" />
    </el-card>
    <el-card shadow="never">
      <div>
        <el-tooltip class="item" effect="dark" content="新增配置" placement="top">
          <el-button
            size="small"
            class="fr mb10"
            type="primary"
            @click="handleEdit(false, {})"
            icon="el-icon-plus"
          />
        </el-tooltip>
      </div>
      <dispose-table @edit="handleEdit" ref="disposeTable" />
    </el-card>
    <dispose-modal @refresh="handleRefresh" ref="disposeModal" />
  </div>
</template>

<script>
import DisposeModal from './DisposeModal'
import DisposeTable from './DisposeTable'
import DisposeForm from './DisposeForm'

export default {
  components: {
    DisposeModal,
    DisposeTable,
    DisposeForm
  },
  methods: {
    handleEdit(bool, obj) {
      this.$refs.disposeModal.edit(bool, obj)
    },
    handleRefresh() {
      this.$refs.disposeTable.handleGetList()
    },
    handleSearch(param) {
      this.$refs.disposeTable.handleGetList(param)
    }
  }
}
</script>